Optimal. Leaf size=55 \[ \frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{a^{5/2} \sqrt {a+b}}+\frac {(a-b) \tanh (x)}{a^2}-\frac {\tanh ^3(x)}{3 a} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3266, 472, 214}
\begin {gather*} \frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{a^{5/2} \sqrt {a+b}}+\frac {(a-b) \tanh (x)}{a^2}-\frac {\tanh ^3(x)}{3 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 214
Rule 472
Rule 3266
Rubi steps
\begin {align*} \int \frac {\text {sech}^4(x)}{a+b \cosh ^2(x)} \, dx &=\text {Subst}\left (\int \frac {\left (1-x^2\right )^2}{x^4 \left (a-(a+b) x^2\right )} \, dx,x,\coth (x)\right )\\ &=\text {Subst}\left (\int \left (\frac {1}{a x^4}+\frac {-a+b}{a^2 x^2}+\frac {b^2}{a^2 \left (a-(a+b) x^2\right )}\right ) \, dx,x,\coth (x)\right )\\ &=\frac {(a-b) \tanh (x)}{a^2}-\frac {\tanh ^3(x)}{3 a}+\frac {b^2 \text {Subst}\left (\int \frac {1}{a-(a+b) x^2} \, dx,x,\coth (x)\right )}{a^2}\\ &=\frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{a^{5/2} \sqrt {a+b}}+\frac {(a-b) \tanh (x)}{a^2}-\frac {\tanh ^3(x)}{3 a}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.10, size = 55, normalized size = 1.00 \begin {gather*} \frac {b^2 \tanh ^{-1}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b}}\right )}{a^{5/2} \sqrt {a+b}}+\frac {\left (2 a-3 b+a \text {sech}^2(x)\right ) \tanh (x)}{3 a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(138\) vs.
\(2(45)=90\).
time = 0.74, size = 139, normalized size = 2.53
method | result | size |
default | \(-\frac {2 b^{2} \left (-\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )+2 \tanh \left (\frac {x}{2}\right ) \sqrt {a}+\sqrt {a +b}\right )}{4 \sqrt {a}\, \sqrt {a +b}}+\frac {\ln \left (\sqrt {a +b}\, \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )-2 \tanh \left (\frac {x}{2}\right ) \sqrt {a}+\sqrt {a +b}\right )}{4 \sqrt {a}\, \sqrt {a +b}}\right )}{a^{2}}-\frac {2 \left (\left (-a +b \right ) \left (\tanh ^{5}\left (\frac {x}{2}\right )\right )+\left (-\frac {2 a}{3}+2 b \right ) \left (\tanh ^{3}\left (\frac {x}{2}\right )\right )+\left (-a +b \right ) \tanh \left (\frac {x}{2}\right )\right )}{a^{2} \left (\tanh ^{2}\left (\frac {x}{2}\right )+1\right )^{3}}\) | \(139\) |
risch | \(-\frac {2 \left (-3 \,{\mathrm e}^{4 x} b +6 \,{\mathrm e}^{2 x} a -6 b \,{\mathrm e}^{2 x}+2 a -3 b \right )}{3 \left (1+{\mathrm e}^{2 x}\right )^{3} a^{2}}+\frac {b^{2} \ln \left ({\mathrm e}^{2 x}+\frac {2 a \sqrt {a^{2}+a b}+b \sqrt {a^{2}+a b}-2 a^{2}-2 a b}{b \sqrt {a^{2}+a b}}\right )}{2 \sqrt {a^{2}+a b}\, a^{2}}-\frac {b^{2} \ln \left ({\mathrm e}^{2 x}+\frac {2 a \sqrt {a^{2}+a b}+b \sqrt {a^{2}+a b}+2 a^{2}+2 a b}{b \sqrt {a^{2}+a b}}\right )}{2 \sqrt {a^{2}+a b}\, a^{2}}\) | \(181\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 119 vs.
\(2 (45) = 90\).
time = 0.48, size = 119, normalized size = 2.16 \begin {gather*} -\frac {b^{2} \log \left (\frac {b e^{\left (-2 \, x\right )} + 2 \, a + b - 2 \, \sqrt {{\left (a + b\right )} a}}{b e^{\left (-2 \, x\right )} + 2 \, a + b + 2 \, \sqrt {{\left (a + b\right )} a}}\right )}{2 \, \sqrt {{\left (a + b\right )} a} a^{2}} + \frac {2 \, {\left (6 \, {\left (a - b\right )} e^{\left (-2 \, x\right )} - 3 \, b e^{\left (-4 \, x\right )} + 2 \, a - 3 \, b\right )}}{3 \, {\left (3 \, a^{2} e^{\left (-2 \, x\right )} + 3 \, a^{2} e^{\left (-4 \, x\right )} + a^{2} e^{\left (-6 \, x\right )} + a^{2}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 608 vs.
\(2 (45) = 90\).
time = 0.39, size = 1377, normalized size = 25.04 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {sech}^{4}{\left (x \right )}}{a + b \cosh ^{2}{\left (x \right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.53, size = 87, normalized size = 1.58 \begin {gather*} \frac {b^{2} \arctan \left (\frac {b e^{\left (2 \, x\right )} + 2 \, a + b}{2 \, \sqrt {-a^{2} - a b}}\right )}{\sqrt {-a^{2} - a b} a^{2}} + \frac {2 \, {\left (3 \, b e^{\left (4 \, x\right )} - 6 \, a e^{\left (2 \, x\right )} + 6 \, b e^{\left (2 \, x\right )} - 2 \, a + 3 \, b\right )}}{3 \, a^{2} {\left (e^{\left (2 \, x\right )} + 1\right )}^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.32, size = 239, normalized size = 4.35 \begin {gather*} \frac {8}{3\,a\,\left (3\,{\mathrm {e}}^{2\,x}+3\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{6\,x}+1\right )}-\frac {4}{a\,\left (2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1\right )}+\frac {2\,b}{a^2\,\left ({\mathrm {e}}^{2\,x}+1\right )}-\frac {b^2\,\ln \left (\frac {4\,b^2\,\left (2\,a\,b+8\,a^2\,{\mathrm {e}}^{2\,x}+b^2\,{\mathrm {e}}^{2\,x}+b^2+8\,a\,b\,{\mathrm {e}}^{2\,x}\right )}{a^5\,\left (a+b\right )}-\frac {8\,b^2\,\left (b+4\,a\,{\mathrm {e}}^{2\,x}+2\,b\,{\mathrm {e}}^{2\,x}\right )}{a^{9/2}\,\sqrt {a+b}}\right )}{2\,a^{5/2}\,\sqrt {a+b}}+\frac {b^2\,\ln \left (\frac {8\,b^2\,\left (b+4\,a\,{\mathrm {e}}^{2\,x}+2\,b\,{\mathrm {e}}^{2\,x}\right )}{a^{9/2}\,\sqrt {a+b}}+\frac {4\,b^2\,\left (2\,a\,b+8\,a^2\,{\mathrm {e}}^{2\,x}+b^2\,{\mathrm {e}}^{2\,x}+b^2+8\,a\,b\,{\mathrm {e}}^{2\,x}\right )}{a^5\,\left (a+b\right )}\right )}{2\,a^{5/2}\,\sqrt {a+b}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________